package com.techstar.ats.codec.live.decoder;

import io.netty.buffer.ByteBuf;
import com.techstar.ats.codec.DateTimeCodec;
import com.techstar.ats.codec.Decoder;
import com.techstar.ats.codec.StringCodec;
import com.techstar.ats.dxp.live.F07DeoptInOut;

public enum F07DeoptInOutDecoder implements Decoder<F07DeoptInOut> {
	INSTANCE;

	public F07DeoptInOut create() {
		return new F07DeoptInOut();
	}

	public void decode(ByteBuf buf, F07DeoptInOut value) {
		value.flag = 0 != buf.readUnsignedShort();
		value.sched = buf.readBoolean();
		value.time = DateTimeCodec.INSTANCE.get(buf);
		value.station = buf.readUnsignedShort();
		value.side = buf.readUnsignedShort();
		value.name = (new StringCodec(20)).get(buf);
		value.train = (new StringCodec(9)).get(buf);
		value.dest = buf.readInt();
		value.global = (new StringCodec(12)).get(buf);
		value.localSub = buf.readInt();
	}
}
